package com.example.springadminclientinflux.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WebHook {

    private static final Logger log = LoggerFactory.getLogger(WebHook.class);

    @RequestMapping(value = {"/hook"})
    public String hook(HttpServletRequest request,@RequestBody String payload){
        String ticket = request.getHeader("Authorization");
        log.info("==================ticket:{}",ticket);
        log.info("================payload:{}",payload);
        return "Hello World";
    }
}
